import java.util.concurrent.CountDownLatch;

public class Task implements Runnable {
	private int mCount = 0;
	private CountDownLatch mLatch;

	public Task(int mCount) {
		super();
		this.mCount = mCount;
		mLatch = new CountDownLatch(mCount);
	}

	@Override
	public void run() {
		try {
			mLatch.countDown();
			System.out.println("doing something 1");
			mLatch.await();

			System.out.println("doing something 2");
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} finally {
		}
		System.out.println("doing something 3");

	}

}
